package com.buddy.hadoop.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataOutputStream;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;

public class CreateFile {

    public static void main(String[] args) throws IOException {
        Configuration conf = new Configuration();
        byte[] bytes = args[0].getBytes();
        FileSystem hdfs = FileSystem.get(conf);
        Path dfs = new Path(args[1]);
        FSDataOutputStream outputStream = hdfs.create(dfs);
        outputStream.write(bytes,0,bytes.length);
    }
}
